package cn.hongyu.service;

import cn.hongyu.domain.User;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(readOnly = true)
public interface UserService {
    /**
     * 添加用户
     * @param user
     * @return
     */
    @Transactional(readOnly = false)
    public boolean save(User user);
    /**
     * 删除用户
     * @param uuid
     * @return
     */
    @Transactional(readOnly = false)
    public boolean delete(Integer uuid);
    /**
     * 修改用户
     * @param user
     * @return
     */
    @Transactional(readOnly = false)
    public boolean update(User user);
    /**
     * 查询单个用户
     * @param uuid
     * @return
     */
    public User findById(Integer uuid);
    /**
     * 查询全部用户
     * @param
     * @return
     */
    public PageInfo<User> findAll(int page, int size);
    /**
     * 查询某些条件用户
     * @param userName,password
     * @return
     */
    public User login(String userName, String password);
}
